
#if !defined(_GAME_H)
#define _GAME_H

#include <string>
#include <vector>
#include <SDL.h>
#include "Rectangle.h"
#include "CollisionChecker.h"
#include "PlayerData.h"
#include "XMLParser.h"
#include "Constants.h"
#include "DomainBuilder.h"


using namespace std;

enum GameStatus { PLAYING, PAUSED, EXIT, FINISHED};

class Game {
private:

	vector<Shape*> shapes;
	GameStatus status;
	int level;
	int bricks;

	//puntos de inicio y fin del stage donde se juega
	int initialX;
	int initialY;
	int finalX;
	int finalY;

	//puntos de inicio del scoreBoard
	int boardInitialX;
	int boardInitialY;

	static Game* singleton; 
	Game();

public:

	virtual ~Game();
	static Game* getInstance(); 



	void setLevel(int level);
	int getLevel();

	vector<Shape*> getShapes();
	void setShapes(vector<Shape*> shapes);

	GameStatus getStatus();
	void setStatus(GameStatus status);

	int getBricks();
	void setBricks(int bricksCount);
	void discountBrick();

	//TODO: cambiar a elipse cuando este implementada!!!
	Circle* getBall();
	Shape* getElipse();
	void updateModels();
	void updateViews(SDL_Surface* screen);
	void checkCollisions();
	void play();
	void reset();

	//metodo que va a generar los niveles
	int prepareLevel(int level,Document* doc, Document* defMandatory, Document* defOptional, bool firstLevel);

	void buildWalls();

	//va a dibujar el background del nivel correspondiente.
	void drawLevelBackground(string textureId);

	int getInitialX();
	int getFinalX();
	int getInitialY();
	int getFinalY();

	int getBoardInitialX();
	int getBoardInitialY();

};

#endif  //_GAME_H
